package com.stlm2.dems.entity.base;

import com.stlm2.dems.entity.GoodsCategoryLevel;

import java.util.Date;

/**
 * Created by apple on 2017/10/13.
 */
public class BaseGoodsRelateCategory {
    /**
     * 唯一标识
     */
    private Integer id;

    /**
     * 商品Id
     */
    private Integer goodsId;

    /**
     * 分类ID
     */
    private Integer goodsCategoryId;

    /**
     * 商品分类名称
     */
    private String categoryName;


    /**
     * 商品分类级别
     */
    private GoodsCategoryLevel goodsCategoryLevel;


    /**
     * 是否有效
     */
    private Boolean isValid;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建用户
     */
    private Integer createUserId;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Integer goodsId) {
        this.goodsId = goodsId;
    }

    public Integer getGoodsCategoryId() {
        return goodsCategoryId;
    }

    public void setGoodsCategoryId(Integer goodsCategoryId) {
        this.goodsCategoryId = goodsCategoryId;
    }


    public GoodsCategoryLevel getGoodsCategoryLevel() {
        return goodsCategoryLevel;
    }

    public void setGoodsCategoryLevel(GoodsCategoryLevel goodsCategoryLevel) {
        this.goodsCategoryLevel = goodsCategoryLevel;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Boolean getIsValid() {
        return isValid;
    }

    public void setIsValid(Boolean isValid) {
       this.isValid = isValid;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Integer createUserId) {
        this.createUserId = createUserId;
    }


    /**
     * 映射：分类等级
     */
    public Integer getGoodsCategoryLevelValue() {
        return (goodsCategoryLevel != null) ? goodsCategoryLevel.getIntValue() : null;
    }

    public void setGoodsCategoryLevelValue(Integer value) {
        if (value != null)
            this.goodsCategoryLevel = GoodsCategoryLevel.getByIntValue(value);
    }
}
